inherited dm_prescritor_secretaria: Tdm_prescritor_secretaria
  OldCreateOrder = True
  Left = 444
  Top = 317
  inherited sqlConsulta: TSQLQuery
    SQL.Strings = (
      'select'
      '  a.cod_secretaria,'
      '  a.lig_cod_prescritor,'
      '  a.descricao,'
      '  a.tel_comercial,'
      '  a.tel_celular,'
      '  a.email,'
      '  a.situacao,'
      '  a.data_cad,'
      '  a.data_alteracao,'
      '  case'
      '    when a.situacao = '#39'True'#39' then '#39'ATIVO'#39' else '#39'INATIVO'#39
      '  end as situacao_desc,'
      '  b.descricao as prescritor'
      'from F_PRESCRITOR_SECRETARIA a'
      
        'left join f_prescritor b on (b.cod_prescritor = a.lig_cod_prescr' +
        'itor)')
  end
  inherited cdsConsulta: TClientDataSet
    object cdsConsultaCOD_SECRETARIA: TIntegerField
      FieldName = 'COD_SECRETARIA'
      Required = True
    end
    object cdsConsultaLIG_COD_PRESCRITOR: TIntegerField
      Alignment = taCenter
      FieldName = 'LIG_COD_PRESCRITOR'
      Required = True
    end
    object cdsConsultaDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsConsultaTEL_COMERCIAL: TStringField
      Alignment = taCenter
      FieldName = 'TEL_COMERCIAL'
    end
    object cdsConsultaTEL_CELULAR: TStringField
      Alignment = taCenter
      FieldName = 'TEL_CELULAR'
    end
    object cdsConsultaEMAIL: TStringField
      FieldName = 'EMAIL'
      Size = 100
    end
    object cdsConsultaSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsConsultaDATA_CAD: TDateField
      FieldName = 'DATA_CAD'
    end
    object cdsConsultaDATA_ALTERACAO: TDateField
      FieldName = 'DATA_ALTERACAO'
    end
    object cdsConsultaSITUACAO_DESC: TStringField
      FieldName = 'SITUACAO_DESC'
      Required = True
      FixedChar = True
      Size = 7
    end
    object cdsConsultaPRESCRITOR: TStringField
      FieldName = 'PRESCRITOR'
      Size = 100
    end
  end
  inherited qryPKChave: TSQLQuery
    SQL.Strings = (
      'SELECT GEN_ID(gen_f_prescritor_secretaria,1)'
      'FROM RDB$DATABASE')
  end
  inherited cdsRegistro: TClientDataSet
    object cdsRegistroCOD_SECRETARIA: TIntegerField
      Alignment = taCenter
      FieldName = 'COD_SECRETARIA'
      Required = True
    end
    object cdsRegistroLIG_COD_PRESCRITOR: TIntegerField
      Alignment = taCenter
      FieldName = 'LIG_COD_PRESCRITOR'
      Required = True
    end
    object cdsRegistroDESCRICAO: TStringField
      FieldName = 'DESCRICAO'
      Required = True
      Size = 100
    end
    object cdsRegistroTEL_COMERCIAL: TStringField
      Alignment = taCenter
      FieldName = 'TEL_COMERCIAL'
    end
    object cdsRegistroTEL_CELULAR: TStringField
      Alignment = taCenter
      FieldName = 'TEL_CELULAR'
    end
    object cdsRegistroEMAIL: TStringField
      FieldName = 'EMAIL'
      Size = 100
    end
    object cdsRegistroSITUACAO: TStringField
      FieldName = 'SITUACAO'
      Size = 5
    end
    object cdsRegistroDATA_CAD: TDateField
      FieldName = 'DATA_CAD'
    end
    object cdsRegistroDATA_ALTERACAO: TDateField
      FieldName = 'DATA_ALTERACAO'
    end
  end
  inherited sqlRegistro: TSQLQuery
    Params = <
      item
        DataType = ftInteger
        Name = 'codigo'
        ParamType = ptInput
      end>
    SQL.Strings = (
      'select'
      '  a.cod_secretaria,'
      '  a.lig_cod_prescritor,'
      '  a.descricao,'
      '  a.tel_comercial,'
      '  a.tel_celular,'
      '  a.email,'
      '  a.situacao,'
      '  a.data_cad,'
      '  a.data_alteracao'
      'from F_PRESCRITOR_SECRETARIA a'
      'where a.cod_secretaria = :codigo')
  end
end
